package inits

import (
	"api-getaway/basic/global"
	__ "api-getaway/proto"
	"google.golang.org/grpc"
	"google.golang.org/grpc/credentials/insecure"
	"log"
)

func init() {
	InitGrpc()
}

func InitGrpc() {
	conn, err := grpc.NewClient("localhost:10002", grpc.WithTransportCredentials(insecure.NewCredentials()))
	if err != nil {
		log.Fatalf("did not connect: %v", err)
	}

	client := __.NewRunServerClient(conn)

	global.UserClient = client
}
